from pymysql import ProgrammingError
import core.excel as e
from core.config import CountryHandler as c

# 入口
if __name__ == "__main__":
    try:
        # 获取config信息
        cdb = c.getConfig(None)
        # 读取excel/连接数据库创建数据表
        e.get_sheet_data(cdb)
    except (IOError,RuntimeError):
        print('ERROR:没有找到文件或读取失败')
    except ProgrammingError:
        print('ERROR:请检查你的Excel文件格式')
    except Exception as e:
        print('ERROR:错误' + e)